<#include "macro/h5.ftl">
<@webpage>

<body class="hold-transition login-page">
<div class="login-box">
    <div class="login-logo">
        <a>库存助手</a>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg">请登录</p>
        <#if error.isPresent()>
            <p>您输入的用户名密码有误，请检查后重新输入</p>
        </#if>
        <form id="loginForm" role="form" action="/login" method="post">
            <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
            <div class="form-group has-feedback">
                <input type="text" class="form-control" name="username" placeholder="USERNAME">
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" class="form-control"  name="password" placeholder="Password">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="row">
                <div class="col-xs-7 col-xs-offset-1">
                    <div class="checkbox icheck">
                        <label>
                            <input type="checkbox" name="remember-me"> 记住密码
                        </label>
                    </div>
                </div>
                <!-- /.col -->
                <div class="col-xs-4">
                    <button type="submit" class="btn btn-primary btn-block btn-flat btn-login">登录</button>
                </div>
                <!-- /.col -->
            </div>
        </form>
        <!-- /.social-auth-links -->

        <a href="${base}/login/forgetPass">忘记密码</a><br>
        <a href="${base}/login/register" class="text-center">注册</a>

    </div>
    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->

<script>
    function initPage(){
        window.location.href='${base}/login';
    }
</script>
</body>
</@webpage>